package com.shijiwei.lifthelper.fragment;


import android.os.Bundle;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;

import com.shijiwei.lifthelper.R;
import com.shijiwei.lifthelper.adapter.OurAdapter;

import org.xutils.common.util.LogUtil;
import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;

import java.util.ArrayList;
import java.util.List;

/**
 * A simple {@link Fragment} subclass.
 */

@ContentView(R.layout.fragment_our)
public class OurFragment extends BaseFragment {

    @ViewInject(R.id.lv_our)
    private ListView ourListView;

    private OurAdapter adapter;
    private List<String> list = new ArrayList<>();

    public static OurFragment newInstance() {
        OurFragment fragment = new OurFragment();
        return fragment;
    }

    @Override
    public void initView() {

        list.add("版本");
        list.add("小操作");
        list.add("意见&建议");
        list.add("关于我们");

        adapter = new OurAdapter(list,getActivity());
        ourListView.setAdapter(adapter);
    }

    @Override
    public void initData() {
        ourListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                LogUtil.e("-------Our");
                adapter.displaySecondItem(view,position);
            }
        });
    }
}
